//Creates an isolation layer between the document and the method of tranformation.
//Allows for:
// The DOM can be manipulated before a trnasform is applied. Example: Insert member data into the page.
// A series of transforms can be applied. Example: Transform content, transform xrefs, transform TLAs.
// Mini transforms can be run on pieces of the document. Example: Just transform the description.
// Allows the XSL to be cached via LUCache.
// Allows for any COM based processing such as regular expression SRs, logging, server event notification. Example: Update the index file, update the targets file, strip comments, find "bad words" and write to a log.
// Allows a document to be constructed from pieces that may be stored seperately. Example: Document may contain description, but parameters may be in source code.
// Allows data pages to be built via XSL. Example: Instead of "build scripts", just have a set of data files that are built via a transform.
var gxmlDoc = new ActiveXObject("Microsoft.XMLDOM"); //The current document reloaded so it can be written to
var gxslDoc = new ActiveXObject("Microsoft.XMLDOM"); //The stylesheet normally used to to trnasform this document
var gErrorMessage;
//main is called from the XSL. It returns the transformed document.
function main(oNode)
{
//debugger;
var sResult="Unknown Failure";
gxmlDoc = oNode.cloneNode(true);
if (!gxmlDoc || gxmlDoc.xml == "")
{
sResult = "Unable to clone XML doc node";
return sResult;
}
// sDocPath=getPath(oNode.url); //The path to this document
// if (!reload(sDocPath))
// {
// sResult=gErrorMessage;
// return sResult;
// }
if (!manipulateDOM()) //Any changes made to the document are done here
{
sResult=gErrorMessage;
return sResult;
}
sResult=transformDoc(); //Now transform the doc and return the results to the XSL
return sResult;
}
//reloadDocument function reloads this document into a global dom variable. Returns success or failure.